package com.sxzt.core.result;

import com.sxzt.core.data.DefaultResponse;
import com.sxzt.core.enum_status.BaseOut;
import com.sxzt.core.enum_status.DefaultBusinessStatus;

public class ResponseUtil<T> extends DefaultResult<T>{

    @Override
    public GlobalResponseConcreteBuilder<T> getBuilder(BaseOut baseOut) {
        return new GlobalResponseConcreteBuilder<>(baseOut);
    }

    @Override
    public DefaultResponse<T> makeResult(BaseOut baseOut, T data) {
        return (DefaultResponse<T>) super.makeResult(baseOut, data);
    }

    @Override
    public DefaultResponse<T> success() {
        return makeResult(DefaultBusinessStatus.SUCCESS, null);
    }


    @Override
    public DefaultResponse<T> error() {
        return makeResult(DefaultBusinessStatus.ERROR, null);
    }
}
